<template>
  <a-card>
    <a-button type="primary" @click="showAddModal">新增批次</a-button>
    <br/>
    <br/>
    <div :style="{display: 'inline-block',width: '50%',border: '1px solid #d9d9d9',borderRadius: '4px',}">
      <a-calendar @panelChange="onPanelChange" />
    </div>
      <div :style="{display: 'inline-block',width: '50%',border: '1px solid #d9d9d9',borderRadius: '4px',}">
      <a-calendar  />
    </div>
    <!-- 新增批次modal -->
    <a-modal v-model="modalvisible" title="新增批次" width="800px" @ok="addbatch">
      <a-form-model :model="batchform" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="项目组">
              <a-select placeholder="请选择项目组" v-model="batchform.projectId" style="width: 150px">
                <a-select-option v-for="projectId in projectList" :key="projectId">{{ projectId }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="投产类型">
              <a-select placeholder="请选择投产类型" v-model="batchform.prodType" style="width: 150px">
                <a-select-option v-for="prodType in prodTypeList" :key="prodType">{{ prodType }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="UAT批次要求">
              <a-select placeholder="UAT批次要求" v-model="batchform.uatRequire" style="width: 150px">
                <a-select-option v-for="uatrequire in requireList" :key="uatrequire">{{ uatrequire }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="创建时间">
              <a-date-picker format="YYYY-MM-DD" v-model="batchform.createTime" style="width: 180px" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="备注">
              <a-textarea v-model="batchform.desc" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-modal>
  </a-card>
</template>

<script>
export default {
  data() {
    return {
      projectList:[],
      requireList:[],
      prodTypeList:[],
      batchform: {},
      modalvisible: false,
    }
  },

  methods: {
    onPanelChange(value, mode) {
      console.log(value, mode)
    },

    showAddModal() {
      this.modalvisible = true
    },

    addbatch() {
      console.log(this.batchform)
      this.modalvisible = false
    },
  },
}
</script>
<style>
   .ant-fullcalendar-header .ant-radio-group{ display:none }
</style>